package com.tbit.uqbike.client.util;

/**
 * @Author: chen
 * @Description:
 * @Date: 创建于 11:12 2020/12/23
 */
public class Test {


    public static void main(String[] args) {
    /*FileOutputStream outputStream = null;
    InputStream inputStream = null;

    int temp = 0;
    try {
      File file1 = new File("C:\\Users\\Administrator\\Desktop\\林小贱 - 站台 (原唱乌兰图雅) [mqms].mp3");
      File file2 = new File("C:\\Users\\Administrator\\Desktop\\合并.mp3");
      inputStream = new FileInputStream(file1);
      outputStream = new FileOutputStream(file2);
      // 原歌曲长度
      System.out.println("file1--size:"+file1.length());  //3578408
      // 截取30秒,原歌曲长3分43秒     30/223*3578408
      byte[] bytes = new byte[481401];
      temp = inputStream.read(bytes);
      outputStream.write(bytes, 0, temp);
      outputStream.flush();
    } catch (FileNotFoundException e) {
      log.error(e.getMessage(), e);
    }catch (IOException e) {
      log.error(e.getMessage(), e);
    }finally{
      try{
        inputStream.close();
        outputStream.close();
      }catch(IOException e){
        log.error(e.getMessage(), e);
      }
    }*/
        String idNO = "421022199910084521";
        String check15 = "^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$";
        String check18 = "^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$";
        boolean result15 = idNO.matches(check15);
        boolean result18 = idNO.matches(check18);
        System.out.println(result15 + "," + result18);
        if (result15 || result18) {
            System.out.println(true);
        }
    }

}
